import com.spj.entity.User;
import com.spj.service.ServiceDao;
import com.spj.service.impl.ServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author :spj
 * @Date:2022/3/29
 * @description:
 */
public class Test {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("springConfig.xml");
        ServiceDao serviceImpl = applicationContext.getBean("serviceImpl", ServiceDao.class);
        User user = new User("spj");
        serviceImpl.addUser(user);
        user.setName("1");
        user.setId(28);
        serviceImpl.chaUser(user);
//        serviceImpl.delUser(28);
        System.out.println(serviceImpl.findUser(28));

    }
}
